<template>
  <div class="header">
      <div class="header-return">
          <div class="iconfont backIcon">&#xe624;</div>
      </div>
      <div class="header-search">
        <span class="iconfont">&#xe632;</span>
        输入城市/景点
      </div>
      <router-link to="/city">
        <div class="header-cities">
            {{this.city}}
            <span class="iconfont downIcon">&#xe615;</span>
        </div>
      </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
      ...mapState (['city'])
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl'
    .header
        display:flex
        line-height: $headerHeight
        background: $bgColor
        color:#fff
        .header-return
            width: .64rem
            float: left
            .backIcon 
                text-align: center
                font-size: .4rem
        .header-search
            flex: 1
            line-height: .64rem
            margin: .12rem .2rem
            padding-left: .2rem
            background #fff
            border-radius: .1rem 
            color: #ccc
        .header-cities
            min-width: 1.04rem
            padding:0 .1rem
            float: right
            text-align: center
            color: #fff
            .downIcon
                font-size: .4rem
</style>
